{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">标签管理</li>
            <li class=""><a href="{:url('admin/label/add')}">添加标签</a></li>
        </ul>
        <div class="layui-tab-content">

            <form class="layui-form layui-form-pane" action="{:url('admin/label/index')}" method="get">
                <div class="layui-inline">
                    <label class="layui-form-label">标签名称</label>
                    <div class="layui-input-inline">
                        <input type="text" name="label_name" value="{:input('param.label_name')}" placeholder="请输入标签名称" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn">搜索</button>
                </div>
            </form>
            <hr>

            <form action="" method="post" class="ajax-form">
                <button type="button" class="layui-btn layui-btn-danger layui-btn-small ajax-action" data-action="{:url('admin/label/delete')}">删除</button>
                <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                            <th style="width: 30px;">ID</th>
                            <th>标签名称</th>
                            <th>标签首字母</th>
                            <th>拼音</th>
                            <th>是否推荐</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        {if condition="$data"}
                        <tbody>
                        {foreach name="data" item="vo"}
                        <tr>
                            <td><input type="checkbox" name="ids[]" value="{$vo.id}"></td>
                            <td>{$vo.id}</td>
                            <td>{$vo.label_name}</td>
                            <td>{$vo.label_fist}</td>
                            <td>{$vo.pingying}</td>
                            <td>{php}echo $vo['is_recommend']==1 ? '是' : '否';{/php}</td>
                            <td>
                                <a href="{:url('admin/label/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                                <a href="{:url('admin/label/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                            </td>
                        </tr>
                        {/foreach}
                        {else/}
                        <tr>
                            <td colspan="15" style="text-align: center;"><i class="fa fa-exclamation-circle"></i>没有数据</td>
                        </tr>
                        {/if}
                        </tbody>
                    </table>
                    <!--分页-->
                    {$page}
                </div>
            </form>
        </div>
    </div>
</div>
{/block}